home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / dvlprstc.hqx / Developer Stack 1.3r / card_45522.txt < prev    next >
Encoding:
Text File  |  1991-04-30  |  754 b   |  39 lines

  1. -- card: 45522 from stack: in.3r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2202
  5. -- name: rnd
  6.  
  7.  
  8. -- part contents for background part 10
  9. ----- text -----
  10. 14
  11.  
  12. -- part contents for background part 19
  13. ----- text -----
  14. Functions
  15.  
  16. -- part contents for background part 3
  17. ----- text -----
  18. rnd
  19.  
  20. -- part contents for background part 2
  21. ----- text -----
  22. -- This function generates a random number
  23. -- between 0 and 1 with any number of
  24. -- digits [e.g. for 35 digits use rnd(35)]
  25. --From:
  26. --Peter Sylvan
  27. --65 Valley Road 
  28. --Milton, MA 02186
  29. --
  30. --I would like to thank Peter for sending in this contribution to the Developer Stack. [Steve].
  31.  
  32. function rnd digits
  33.   put "0." into r
  34.   repeat digits
  35.     put r & random(10)-1 into r
  36.   end repeat
  37.   return r
  38. end rnd
  39.